package com.yc.mybatis.core;

public class ConnecitonPoolFactory {
	private static ConnectionPool connectionPool = null;
	
	private ConnecitonPoolFactory() {
		
	}
	
	protected synchronized static void create(String driver, String url, String username, String password){ 
		if(connectionPool == null) {
			connectionPool = new ConnectionPool(driver, url, username, password);
			try {
				connectionPool.createPool();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
		
	protected static ConnectionPool getInstance() {
		return connectionPool;
	}
}
